home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / XmP.h.z / XmP.h
C/C++ Source or Header  |  2002-10-15  |  47KB  |  1,431 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /*   $TOG: XmP.h /main/23 1997/09/15 14:22:29 cshi $ */
  12. /* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  13.  
  14. /************************************<+>*************************************
  15.  ****************************************************************************
  16.  **
  17.  **   File:        XmP.h
  18.  **
  19.  **   Description: This include file contains the class and instance record
  20.  **                definitions for all meta classes.  It also contains externs
  21.  **                for internally shared functions and defines for internally 
  22.  **                shared values.
  23.  **
  24.  ****************************************************************************
  25.  ************************************<+>*************************************/
  26. #ifndef _XmP_h
  27. #define _XmP_h
  28.  
  29. /* 
  30.  * _SGIMOTIF is SGIs look and feel. Turning this off during compilation
  31.  *  of an application would be a bad idea, all the widget structure offsets 
  32.  *  will be wrong compared to the shipped library---rmo
  33.  */
  34. #ifndef _NO_SGIMOTIF
  35. #undef _SGIMOTIF 
  36. #define _SGIMOTIF TRUE
  37. #else
  38. #undef _SGIMOTIF 
  39. #endif
  40.  
  41. /* _SGIBUGFIX is a wrapper around SGI bug fixes. This is also mainly used 
  42.  * internal to the library --- rmo
  43.  */
  44. #ifndef _NO_SGIBUGFIX
  45. #undef _SGIBUGFIX
  46. #define _SGIBUGFIX TRUE
  47. #else
  48. #undef _SGIBUGFIX
  49. #endif
  50.  
  51. /* _SGIMOTIFAPI is used to wrap the extenstions to the Motif API that SGI have 
  52.  * made. This may be turned off during application compilation to ensure 
  53.  * that no SGI extensions have been used---rmo
  54.  */    
  55. #ifdef _SGIMOTIF
  56. #ifndef _NO_SGIMOTIFAPI
  57. #undef     _SGIMOTIFAPI
  58. #define _SGIMOTIFAPI TRUE
  59. #else
  60. #undef _SGIMOTIFAPI
  61. #endif
  62. #endif /* _SGIMOTIF */    
  63.     
  64.  
  65. #include <Xm/Xm.h>
  66. #include <X11/IntrinsicP.h>
  67. #include <X11/ObjectP.h>
  68. #include <Xm/ColorP.h>
  69. #include <Xm/AccColorT.h>
  70.  
  71. #ifdef _SGIMOTIF
  72. #include <Xm/SgiP.h>
  73. #ifdef _SGIMOTIFAPI
  74. #include <Xm/SGIApiP.h>
  75. #endif
  76. #endif /* _SGIMOTIF */
  77.  
  78. #ifdef __cplusplus
  79. extern "C" {
  80. #endif
  81.  
  82.  
  83. /***************************************************************************
  84.  *
  85.  *  Macros replacing toolkit macros so that gadgets are handled properly.
  86.  * 
  87.  ***************************************************************************/
  88.  
  89. /* Temporary hack until we can clean up our own code. ??? */
  90. #ifndef NO_XM_1_2_XTMACROS
  91. #define XM_1_2_XTMACROS        1
  92. #endif
  93.  
  94. #ifdef XM_1_2_XTMACROS
  95.  
  96. /* XtClass is a macro in IntrinsicP.h, but it does no casting 
  97.    so removing this one would certainly generate warnings everywhere, 
  98.    we can keep it */
  99. #ifdef XtClass
  100. #undef XtClass
  101. #endif
  102. #define XtClass(widget)    (((Object)(widget))->object.widget_class)
  103.  
  104.  
  105. /* Exist in IntrinsicP.h, but does no casting, so removing this
  106.    one will probably generate a lot of warnings */
  107. #ifdef XtParent
  108. #undef XtParent
  109. #endif
  110. #define XtParent(widget) (((Object)(widget))->object.parent)
  111.  
  112.  
  113. /* The following routines exist in Xt, but do not accept Gadgets. */
  114.  
  115. #ifdef XtDisplay
  116. #undef XtDisplay
  117. #endif
  118. #define XtDisplay(widget)     XtDisplayOfObject((Widget) widget)
  119.  
  120. #ifdef XtScreen
  121. #undef XtScreen
  122. #endif
  123. #define XtScreen(widget)     XtScreenOfObject((Widget) widget)
  124.  
  125. #ifdef XtWindow
  126. #undef XtWindow
  127. #endif
  128. #define XtWindow(widget)     XtWindowOfObject((Widget) widget)
  129.  
  130.  
  131. /* The following macros are not provided by Xt */
  132. #define XtX(w)           ((w)->core.x)
  133. #define XtY(w)           ((w)->core.y)
  134. #define XtWidth(w)       ((w)->core.width)
  135. #define XtHeight(w)       ((w)->core.height)
  136. #define XtBorderWidth(w)   ((w)->core.border_width)
  137. #define XtBackground(w)       ((w)->core.background_pixel)
  138. #define XtCoreProc(w,proc) ((w)->core.widget_class->core_class.proc)
  139.  
  140. #endif /* XM_1_2_XTMACROS */
  141.  
  142.  
  143. /***********************************************************************
  144.  *
  145.  * Miscellaneous SemiPrivate Defines
  146.  *
  147.  ***********************************************************************/
  148.  
  149. /* new for the initialized gadget checking */
  150. #define XmNdotCache   ".cache"
  151. #define XmCDotCache   ".Cache"
  152.  
  153. #define XmDELAYED_PIXMAP  (XmUNSPECIFIED_PIXMAP - 1)
  154.  
  155. #define XmUNSPECIFIED        (~0)
  156. #define XmUNSPECIFIED_COUNT    (~0)
  157.  
  158.  
  159. /* Used by conversion routine in ResConvert.c, RepType.c, IconG.c, etc */
  160.  
  161. #define _XM_CONVERTER_DONE( to_rtn, type, value, failure )    \
  162.     {                            \
  163.       static type buf ;                    \
  164.                             \
  165.       if (to_rtn->addr)                    \
  166.         {                        \
  167.           if (to_rtn->size < sizeof(type))        \
  168.             {                        \
  169.               failure                    \
  170.               to_rtn->size = sizeof(type);        \
  171.               return FALSE;                \
  172.             }                        \
  173.           else                        \
  174.         {                          \
  175.           *((type *) (to_rtn->addr)) = value;    \
  176.             }                        \
  177.         }                        \
  178.       else                        \
  179.         {                        \
  180.           buf = value;                    \
  181.           to_rtn->addr = (XPointer) &buf;        \
  182.         }                        \
  183.       to_rtn->size = sizeof(type);            \
  184.       return TRUE;                    \
  185.     } 
  186.  
  187.  
  188.  
  189. /* defines needed for 3D visual enhancement of defaultButtonshadow and
  190.  *  implementation of ToggleButton Indicatorsize. **/
  191.  
  192. #define Xm3D_ENHANCE_PIXEL        2
  193. #define XmINDICATOR_SHADOW_THICKNESS    2
  194.  
  195. #define XmINVALID_DIMENSION        0xFFFF
  196.  
  197. /***********************************************************************
  198.  *
  199.  * Const stuff
  200.  *
  201.  ***********************************************************************/
  202.  
  203. #ifndef XmConst
  204. #if defined(__STDC__) || !defined( NO_CONST )
  205. #define XmConst const
  206. #else
  207. #define XmConst
  208. #endif /* __STDC__ */
  209. #endif /* XmConst */
  210.  
  211.  
  212. /***********************************************************************
  213.  *
  214.  * Status for menus
  215.  *
  216.  ***********************************************************************/
  217.  
  218. /* Defines used for menu/button communication */
  219. enum{    XmMENU_POPDOWN,            XmMENU_PROCESS_TREE,
  220.     XmMENU_TRAVERSAL,        XmMENU_SHELL_POPDOWN,
  221.     XmMENU_CALLBACK,        XmMENU_BUTTON,
  222.     XmMENU_CASCADING,        XmMENU_SUBMENU,
  223.     XmMENU_ARM,            XmMENU_DISARM,
  224.     XmMENU_BAR_CLEANUP,        XmMENU_STATUS,
  225.     XmMENU_MEMWIDGET_UPDATE,    XmMENU_BUTTON_POPDOWN,
  226.     XmMENU_RESTORE_EXCLUDED_TEAROFF_TO_TOPLEVEL_SHELL,
  227.     XmMENU_RESTORE_TEAROFF_TO_TOPLEVEL_SHELL,
  228.     XmMENU_RESTORE_TEAROFF_TO_MENUSHELL,
  229.     XmMENU_GET_LAST_SELECT_TOPLEVEL,
  230.     XmMENU_TEAR_OFF_ARM
  231.     } ;
  232.  
  233.  
  234.  
  235. #define XmMENU_TORN_BIT                         (1 << 0)
  236. #define XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT    (1 << 1)
  237. #define XmMENU_POPUP_POSTED_BIT            (1 << 2)
  238. #define XmMENU_IN_DRAG_MODE_BIT            (1 << 3)
  239.  
  240. #define XmIsTorn(mask)                \
  241.     (mask & XmMENU_TORN_BIT)
  242. #define XmIsTearOffShellDescendant(mask)    \
  243.     (mask & XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT)
  244. #define XmPopupPosted(mask)                \
  245.     (mask & XmMENU_POPUP_POSTED_BIT)
  246. #define XmIsInDragMode(mask)            \
  247.     (mask & XmMENU_IN_DRAG_MODE_BIT)
  248.  
  249. typedef void (*XmMenuProc)( int, Widget, ...) ;
  250.  
  251. /***********************************************************************
  252.  *
  253.  * Simple Menu Structure
  254.  *
  255.  ***********************************************************************/
  256.  
  257. typedef struct _XmSimpleMenuRec {
  258.     int count;
  259.     int post_from_button;
  260.     XtCallbackProc callback;
  261.     XmStringTable label_string;
  262.     String *accelerator;
  263.     XmStringTable accelerator_text;
  264.     XmKeySymTable mnemonic;
  265.     XmStringCharSetTable mnemonic_charset;
  266.     XmButtonTypeTable button_type;
  267.     int button_set;
  268.     XmString option_label;
  269.         KeySym option_mnemonic;
  270. } XmSimpleMenuRec, * XmSimpleMenu;
  271.  
  272.  
  273. /* For MapEvent: _XmMatchBtnEvent */
  274. #define XmIGNORE_EVENTTYPE      -1
  275.  
  276. /* Default minimum Toggle indicator dimension */
  277. #define XmDEFAULT_INDICATOR_DIM   9
  278.  
  279.  
  280.  
  281.  
  282.  
  283. /************************************************************************
  284.  *
  285.  *  SyntheticP.h
  286.  *
  287.  ************************************************************************/
  288.  
  289. typedef enum{ XmSYNTHETIC_NONE, XmSYNTHETIC_LOAD } XmImportOperator ;
  290.  
  291. typedef void (*XmExportProc)( Widget, int, XtArgVal *) ;
  292. typedef XmImportOperator (*XmImportProc)( Widget, int, XtArgVal *) ;
  293.  
  294. typedef struct _XmSyntheticResource
  295. {
  296.    String   resource_name;
  297.    Cardinal resource_size;
  298.    Cardinal resource_offset;
  299.    XmExportProc export_proc;
  300.    XmImportProc import_proc;
  301. } XmSyntheticResource;
  302.  
  303.  
  304.  
  305. /***********************************************************************
  306.  *
  307.  *  ParProcP.h
  308.  *
  309.  ***********************************************************************/
  310.  
  311.  
  312. typedef struct
  313. {
  314.    int          process_type ;  /* Common to all parent process records. */
  315.    } XmParentProcessAnyRec ;
  316.  
  317. typedef struct
  318.    int          process_type ;  /* Common to all parent process records. */
  319.    XEvent *     event ;
  320.    int          action ;
  321.    String *     params ;
  322.    Cardinal *   num_params ;
  323. } XmParentInputActionRec ;
  324.  
  325. typedef union
  326. {
  327.    XmParentProcessAnyRec  any ;
  328.    XmParentInputActionRec input_action ;
  329. } XmParentProcessDataRec, * XmParentProcessData ;
  330.  
  331. enum{   XmPARENT_PROCESS_ANY,  XmINPUT_ACTION
  332.     } ;
  333. enum{    XmPARENT_ACTIVATE,        XmPARENT_CANCEL
  334.     } ;
  335. #define XmRETURN XmPARENT_ACTIVATE       /* For Motif 1.1 BC. */
  336. #define XmCANCEL XmPARENT_CANCEL         /* For Motif 1.1 BC. */
  337.  
  338.  
  339. /***********************************************************************
  340.  *
  341.  * BaselineP.h
  342.  *
  343.  ***********************************************************************/
  344.  
  345. enum{    XmBASELINE_GET,            XmBASELINE_SET
  346.     } ;
  347.  
  348. typedef struct _XmBaselineMargins
  349. {
  350.   unsigned char get_or_set;
  351.   Dimension margin_top;
  352.   Dimension margin_bottom;
  353.   Dimension shadow;
  354.   Dimension highlight;
  355.   Dimension text_height;
  356.   Dimension margin_height;
  357. } XmBaselineMargins;
  358.  
  359.  
  360. typedef enum{ XmFOCUS_IN, XmFOCUS_OUT, XmENTER, XmLEAVE } XmFocusChange ;
  361.  
  362. typedef enum{
  363.         XmNOT_NAVIGABLE,                XmCONTROL_NAVIGABLE,
  364.     XmTAB_NAVIGABLE,                XmDESCENDANTS_NAVIGABLE,
  365.     XmDESCENDANTS_TAB_NAVIGABLE
  366.   } XmNavigability ;
  367.  
  368. /***********************************************************************
  369.  *
  370.  * Various proc types
  371.  *
  372.  ***********************************************************************/
  373.  
  374. #define XmVoidProc      XtProc
  375.  
  376.  
  377. typedef Boolean (*XmParentProcessProc)( Widget, XmParentProcessData) ;
  378. typedef void (*XmWidgetDispatchProc)( Widget, XEvent *, Mask) ;
  379. typedef void (*XmGrabShellPopupProc)( Widget, Widget, XEvent *) ;
  380. typedef void (*XmMenuPopupProc)( Widget, Widget, XEvent *) ;
  381. typedef void (*XmMenuTraversalProc)( Widget, Widget, XmTraversalDirection) ;
  382. typedef void (*XmResizeFlagProc)(
  383.             Widget,
  384. #if NeedWidePrototypes
  385.             int) ;
  386. #else
  387.             Boolean) ;
  388. #endif /* NeedWidePrototypes */
  389. typedef void (*XmRealizeOutProc)( Widget, Mask *, XSetWindowAttributes *) ;
  390. typedef Boolean (*XmVisualChangeProc)( Widget, Widget, Widget) ;
  391. typedef void (*XmTraversalProc)( Widget, XtPointer, XtPointer, int) ;
  392. typedef void (*XmFocusMovedProc)( Widget, XtPointer, XtPointer) ;
  393. typedef void (*XmCacheCopyProc)( XtPointer, XtPointer, size_t) ;
  394. typedef void (*XmGadgetCacheProc)( XtPointer) ;
  395. typedef int (*XmCacheCompareProc)( XtPointer, XtPointer) ;
  396. typedef Boolean (*XmWidgetBaselineProc)(Widget, Dimension **, int *);
  397. typedef Boolean (*XmWidgetDisplayRectProc)(Widget, XRectangle *);
  398. typedef void (*XmWidgetMarginsProc)(Widget, XmBaselineMargins *);
  399. typedef XmNavigability (*XmWidgetNavigableProc)( Widget) ;
  400. typedef void (*XmFocusChangeProc)(Widget, XmFocusChange);
  401. typedef Boolean (*XmSpatialPlacementProc)(Widget, Widget, unsigned char);
  402. typedef Boolean (*XmSpatialRemoveProc)(Widget, Widget);
  403. typedef Boolean (*XmSpatialTestFitProc)(Widget, Widget, Position, Position);
  404.  
  405.  
  406. /****************
  407.  *
  408.  * Data structure for building a real translation table out of a 
  409.  * virtual string.
  410.  *
  411.  ****************/
  412.  
  413. typedef struct {
  414.   Modifiers mod;
  415.   char      *key;
  416.   char      *action;
  417. } _XmBuildVirtualKeyStruct;
  418.               
  419. typedef struct _XmKeyBindingRec
  420. {
  421.   KeySym    keysym;
  422.   Modifiers    modifiers;
  423. } XmKeyBindingRec, *XmKeyBinding;
  424.  
  425.  
  426. /***********************************************************************
  427.  *
  428.  * Types shared by text widgets
  429.  *
  430.  ***********************************************************************/
  431.  
  432. /* see comment at the bottom of Xm.h */
  433. #if defined(_SGIBUGFIX) && defined(_SGI_OSF_PUBLIC_SYMBOLS)
  434. typedef enum { XmsdLeft, XmsdRight } XmTextScanDirection;
  435. #endif /* _SGIBUGFIX */
  436.  
  437.  
  438. /*
  439.  * This struct is for support of Insert Selection targets.
  440.  */
  441. typedef struct {
  442.     Atom selection;
  443.     Atom target;
  444. } _XmTextInsertPair;
  445.  
  446. typedef struct {
  447.     XmTextPosition position;    /* Starting position. */
  448.     XmHighlightMode mode;       /* Highlighting mode for this position. */
  449. } _XmHighlightRec;
  450.  
  451. typedef struct {
  452.     Cardinal number;            /* Number of different highlight areas. */
  453.     Cardinal maximum;           /* Number we've allocated space for. */
  454.     _XmHighlightRec *list;      /* Pointer to array of highlight data. */
  455. } _XmHighlightData;
  456.  
  457. typedef enum { XmDEST_SELECT, XmPRIM_SELECT } XmSelectType;
  458.  
  459. typedef struct {
  460.     Boolean done_status;    /* completion status of insert selection */
  461.     Boolean success_status;    /* success status of insert selection */
  462.     XmSelectType select_type;    /* insert selection type */
  463.     XSelectionRequestEvent *event; /* event that initiated the
  464.                       insert selection */
  465. } _XmInsertSelect;
  466.  
  467. typedef struct {
  468.     XEvent *event;
  469.     String *params;
  470.     Cardinal *num_params;
  471. } _XmTextActionRec;
  472.  
  473. typedef struct {
  474.     Widget widget;
  475.     XmTextPosition insert_pos;
  476.     int num_chars;
  477.     Time timestamp;
  478.     Boolean move;
  479. } _XmTextDropTransferRec;
  480.  
  481. typedef struct {
  482.     XmTextPosition position;
  483.     Atom target;
  484.     Time time;
  485.     int num_chars;
  486.     int ref_count;
  487. } _XmTextPrimSelect;
  488.  
  489. typedef struct {
  490.     Screen *screen;
  491.     XContext context;
  492.     unsigned char type;
  493. } XmTextContextDataRec, *XmTextContextData;
  494.  
  495. enum {_XM_IS_DEST_CTX, _XM_IS_GC_DATA_CTX, _XM_IS_PIXMAP_CTX};
  496.  
  497. #define XmTEXT_DRAG_ICON_WIDTH    64
  498. #define XmTEXT_DRAG_ICON_HEIGHT 64
  499. #define XmTEXT_DRAG_ICON_X_HOT    10
  500. #define XmTEXT_DRAG_ICON_Y_HOT     4
  501.  
  502.  
  503. /***********************************************************************
  504.  *
  505.  * GeoUtilsP.h
  506.  *
  507.  ***********************************************************************/
  508.  
  509. /* Defines used by geometry manager utilities */
  510.  
  511. enum{    XmGET_ACTUAL_SIZE = 1,        XmGET_PREFERRED_SIZE,
  512.     XmGEO_PRE_SET,            XmGEO_POST_SET
  513.     } ;
  514.  
  515. /* Defaults for Geometry Utility defines are always 0. */
  516. enum{    XmGEO_EXPAND,            XmGEO_CENTER,
  517.     XmGEO_PACK
  518. #if defined(_SGIMOTIF) && defined(_SGIMOTIFAPI)
  519.     , SgGEO_PACK_RIGHT /* new spacing constant for right-justified buttons */
  520. #endif
  521.     } ;
  522. enum{    XmGEO_PROPORTIONAL,        XmGEO_AVERAGING,
  523.     XmGEO_WRAP
  524.     } ;
  525. enum{    XmGEO_ROW_MAJOR,        XmGEO_COLUMN_MAJOR
  526.     } ;
  527. /* XmGEO_COLUMN_MAJOR is not yet supported. */
  528.  
  529.  
  530. typedef struct _XmGeoMatrixRec *XmGeoMatrix ;
  531. typedef union _XmGeoMajorLayoutRec *XmGeoMajorLayout ;
  532. typedef struct _XmKidGeometryRec
  533. {
  534.     Widget   kid;                /* ptr to kid */
  535.     XtWidgetGeometry    box;            /* kid geo box */
  536. } XmKidGeometryRec, *XmKidGeometry;
  537.  
  538. typedef void (*XmGeoArrangeProc)( XmGeoMatrix,
  539. #if NeedWidePrototypes
  540.                  int, int,
  541. #else
  542.                  Position, Position,
  543. #endif /* NeedWidePrototypes */
  544.                  Dimension *, Dimension *) ;
  545. typedef Boolean (*XmGeoExceptProc)( XmGeoMatrix ) ;
  546. typedef void (*XmGeoExtDestructorProc)( XtPointer ) ;
  547. typedef void (*XmGeoSegmentFixUpProc)( XmGeoMatrix, int, XmGeoMajorLayout,
  548.                                                                XmKidGeometry) ;
  549.  
  550. typedef struct
  551. {   Boolean         end ;        /* Flag to mark end of rows.                */
  552.     XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts.          */
  553.     Dimension       even_width ; /* If non-zero, set all boxes to same width.*/
  554.     Dimension       even_height ;/* If non-zero, set all boxes to same height*/
  555.     Dimension       min_height ; /* Minimum height, if stretch_height TRUE.  */
  556.     Boolean         stretch_height ;/* Stretch height to fill vertically.    */
  557.     Boolean         uniform_border ;/* Enforce on all kids this row, dflt F. */
  558.     Dimension       border ;        /* Value to use if uniform_border set.   */
  559.     unsigned char   fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/
  560.                 /*   or XmGEO_EXPAND (default).              */
  561.     unsigned char   fit_mode ;  /* Method for fitting boxes into space,      */
  562.                 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/
  563.     Boolean         sticky_end ;  /* Last box in row sticks to edge, dflt F. */
  564.     Dimension       space_above ; /* Between-line spacing, default 0.        */
  565.     Dimension       space_end ;   /* End spacing (XmGEO_CENTER), default 0.  */
  566.     Dimension       space_between ; /* Internal spacing, default 0.          */
  567.     Dimension       max_box_height ;/* Set during arrange routine.           */
  568.     Dimension       boxes_width ;   /* Set during arrange routine.           */
  569.     Dimension       fill_width ;    /* Set during arrange routine.           */
  570.     Dimension       box_count ;     /* Set during arrange routine.           */
  571.     } XmGeoRowLayoutRec, *XmGeoRowLayout ;
  572.  
  573. typedef struct
  574. {   Boolean         end ;        /* Flag to mark end of columns.             */
  575.     XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts.          */
  576.     Dimension       even_height ;/* If non-zero, set all boxes to same height*/
  577.     Dimension       even_width ; /* If non-zero, set all boxes to same width.*/
  578.     Dimension       min_width ;  /* Minimum width, if stretch_width TRUE.  */
  579.     Boolean         stretch_width ;/* Stretch width to fill horizontally.    */
  580.     Boolean         uniform_border ;/* Enforce on all kids this row, dflt F. */
  581.     Dimension       border ;        /* Value to use if uniform_border set.   */
  582.     unsigned char   fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/
  583.                 /*   or XmGEO_EXPAND (default).              */
  584.     unsigned char   fit_mode ;  /* Method for fitting boxes into space,      */
  585.                 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/
  586.     Boolean         sticky_end ;  /* Last box in row sticks to edge, dflt F. */
  587.     Dimension       space_left ;  /* Between-column spacing, default 0.      */
  588.     Dimension       space_end ;   /* End spacing (XmGEO_CENTER), default 0.  */
  589.     Dimension       space_between ; /* Internal spacing, default 0.          */
  590.     Dimension       max_box_width ; /* Set during arrange routine.           */
  591.     Dimension       boxes_height ;  /* Set during arrange routine.           */
  592.     Dimension       fill_height ;   /* Set during arrange routine.           */
  593.     Dimension       box_count ;     /* Set during arrange routine.           */
  594.     } XmGeoColumnLayoutRec, *XmGeoColumnLayout ;
  595.  
  596. typedef union _XmGeoMajorLayoutRec
  597. {
  598.   XmGeoRowLayoutRec row ;
  599.   XmGeoColumnLayoutRec col ;
  600. } XmGeoMajorLayoutRec ;
  601.  
  602. typedef struct _XmGeoMatrixRec
  603. {   Widget          composite ;     /* Widget managing layout.               */
  604.     Widget          instigator ;    /* Widget initiating re-layout.          */
  605.     XtWidgetGeometry instig_request ;/* Geometry layout request of instigatr.*/
  606.     XtWidgetGeometry parent_request ;/* Subsequent layout request to parent. */
  607.     XtWidgetGeometry *in_layout ;   /* Geo. of instig. in layout (after Get).*/
  608.     XmKidGeometry   boxes ;/* Array of boxes, lines separated by NULL record.*/
  609.     XmGeoMajorLayout layouts ;      /* Array of major_order format info.     */
  610.     Dimension       margin_w ;/*Sum of margin, highlight, & shadow thickness.*/
  611.     Dimension       margin_h ;/*Sum of margin, highlight, & shadow thickness.*/
  612.     Boolean         stretch_boxes ; /* Set during arrange routine.           */
  613.     Boolean         uniform_border ;/* Enforce on all kids, default FALSE.   */
  614.     Dimension       border ;        /* Value to use if uniform_border TRUE.  */
  615.     Dimension       max_major ;     /* Set during arrange routine.           */
  616.     Dimension       boxes_minor ;   /* Set during arrange routine.           */
  617.     Dimension       fill_minor ;    /* Set during arrange routine.           */
  618.     Dimension       width ;         /* Set during arrange routine.           */
  619.     Dimension       height ;        /* Set during arrange routine.           */
  620.     XmGeoExceptProc set_except ;
  621.     XmGeoExceptProc almost_except ;
  622.     XmGeoExceptProc no_geo_request ;
  623.     XtPointer       extension ;
  624.     XmGeoExtDestructorProc ext_destructor ;
  625.     XmGeoArrangeProc arrange_boxes ;/* For user-defined arrangement routine. */
  626.     unsigned char   major_order ;
  627.     } XmGeoMatrixRec;
  628.  
  629. typedef XmGeoMatrix (*XmGeoCreateProc)( Widget, Widget, XtWidgetGeometry *) ;
  630.  
  631. /***********************************************************************
  632.  *
  633.  * XmInheritP.h
  634.  *
  635.  ***********************************************************************/
  636.  
  637.  
  638. #define XmInheritCallbackProc ((XtCallbackProc) _XtInherit)
  639. #define XmInheritTraversalProc ((XmTraversalProc) _XtInherit)
  640. #define XmInheritParentProcess ((XmParentProcessProc) _XtInherit)
  641. #define XmInheritWidgetProc ((XtWidgetProc) _XtInherit)
  642. #define XmInheritMenuProc ((XmMenuProc) _XtInherit)
  643. #define XmInheritTranslations XtInheritTranslations
  644. #define XmInheritCachePart    ((XmCacheClassPartPtr) _XtInherit)
  645. #define XmInheritBaselineProc ((XmWidgetBaselineProc) _XtInherit)
  646. #define XmInheritDisplayRectProc ((XmWidgetDisplayRectProc) _XtInherit)
  647. #define XmInheritMarginsProc ((XmWidgetMarginsProc) _XtInherit)
  648. #define XmInheritGeoMatrixCreate ((XmGeoCreateProc) _XtInherit)
  649. #define XmInheritFocusMovedProc ((XmFocusMovedProc) _XtInherit)
  650. #define XmInheritClass           ((WidgetClass) &_XmInheritClass)
  651. #define XmInheritInitializePrehook ((XtInitProc) _XtInherit)
  652. #define XmInheritSetValuesPrehook  ((XtSetValuesFunc) _XtInherit)
  653. #define XmInheritGetValuesPrehook  ((XtArgsProc) _XtInherit)
  654. #define XmInheritInitializePosthook ((XtInitProc) _XtInherit)
  655. #define XmInheritSetValuesPosthook  ((XtSetValuesFunc) _XtInherit)
  656. #define XmInheritGetValuesPosthook  ((XtArgsProc) _XtInherit)
  657. #define XmInheritSecObjectCreate   ((XtInitProc) _XtInherit)
  658. #define XmInheritGetSecResData       ((XmGetSecResDataFunc) _XtInherit)
  659. #define XmInheritInputDispatch       ((XmWidgetDispatchProc) _XtInherit)
  660. #define XmInheritVisualChange       ((XmVisualChangeProc) _XtInherit)
  661. #define XmInheritArmAndActivate       ((XtActionProc) _XtInherit)
  662. #define XmInheritActionProc       ((XtActionProc) _XtInherit)
  663. #define XmInheritFocusChange       ((XmFocusChangeProc) _XtInherit)
  664. #define XmInheritWidgetNavigable   ((XmWidgetNavigableProc) _XtInherit)
  665. #define XmInheritClassPartInitPrehook ((XtWidgetClassProc) _XtInherit)
  666. #define XmInheritClassPartInitPosthook ((XtWidgetClassProc) _XtInherit)
  667. #define XmInheritBorderHighlight   ((XtWidgetProc) _XtInherit)
  668. #define XmInheritBorderUnhighlight   ((XtWidgetProc) _XtInherit)
  669.  
  670.  
  671. /************************************************************************
  672.  *
  673.  *  Fast subclassing macros and definitions
  674.  *
  675.  ************************************************************************/
  676. /* WARNING:  Application subclasses which choose to use fast
  677.  *           subclassing must use only those bits between
  678.  *           192 (XmFIRST_APPLICATION_SUBCLASS_BIT) and 255.
  679.  *           All other fast subclass bits are reserved for
  680.  *           future use.  Use of reserved fast subclass bits
  681.  *           will cause binary compatibility breaks with
  682.  *           future Motif versions.
  683.  */
  684. #define XmFIRST_APPLICATION_SUBCLASS_BIT    192
  685.  
  686. enum{    XmCASCADE_BUTTON_BIT = 1,    XmCASCADE_BUTTON_GADGET_BIT,
  687.     XmCOMMAND_BOX_BIT,        XmDIALOG_SHELL_BIT,
  688.     XmLIST_BIT,            XmFORM_BIT,
  689.     XmTEXT_FIELD_BIT,        XmGADGET_BIT,
  690.     XmLABEL_BIT,            XmLABEL_GADGET_BIT,
  691.     XmMAIN_WINDOW_BIT,        XmMANAGER_BIT,
  692.     XmMENU_SHELL_BIT,        XmDRAWN_BUTTON_BIT,
  693.     XmPRIMITIVE_BIT,        XmPUSH_BUTTON_BIT,
  694.     XmPUSH_BUTTON_GADGET_BIT,    XmROW_COLUMN_BIT,
  695.     XmSCROLL_BAR_BIT,        XmSCROLLED_WINDOW_BIT,
  696.     XmSELECTION_BOX_BIT,        XmSEPARATOR_BIT,
  697.     XmSEPARATOR_GADGET_BIT,        XmTEXT_BIT,
  698.     XmTOGGLE_BUTTON_BIT,        XmTOGGLE_BUTTON_GADGET_BIT,
  699.     XmDROP_TRANSFER_BIT,        XmDROP_SITE_MANAGER_BIT,
  700.     XmDISPLAY_BIT,            XmSCREEN_BIT,
  701.     XmPRINT_SHELL_BIT,        XmARROW_BUTTON_BIT,
  702.     XmARROW_BUTTON_GADGET_BIT,    XmBULLETIN_BOARD_BIT,
  703.     XmDRAWING_AREA_BIT,        XmFILE_SELECTION_BOX_BIT,
  704.     XmFRAME_BIT,            XmMESSAGE_BOX_BIT,
  705.     XmSASH_BIT,            XmSCALE_BIT,
  706.     XmPANED_WINDOW_BIT,        XmVENDOR_SHELL_BIT,
  707.     XmCLIP_WINDOW_BIT,            XmDRAG_ICON_BIT,
  708.     XmTEAROFF_BUTTON_BIT,        XmDRAG_OVER_SHELL_BIT,
  709.     XmDRAG_CONTEXT_BIT,        XmCONTAINER_BIT,
  710.     XmICONGADGET_BIT,        XmNOTEBOOK_BIT,
  711.     XmCSTEXT_BIT,                XmGRAB_SHELL_BIT,
  712.     XmCOMBO_BOX_BIT,        XmSPINBOX_BIT,        
  713.     XmICONHEADER_BIT,    
  714.  
  715.     XmFAST_SUBCLASS_TAIL_BIT /* New entries precede this. */
  716.     } ;
  717.  
  718. #define XmLAST_FAST_SUBCLASS_BIT (XmFAST_SUBCLASS_TAIL_BIT - 1) 
  719.  
  720.  
  721. #undef XmIsCascadeButton
  722. #define XmIsCascadeButton(w)  \
  723.   (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_BIT))
  724.  
  725. #undef XmIsCascadeButtonGadget
  726. #define XmIsCascadeButtonGadget(w)  \
  727.   (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_GADGET_BIT))
  728.  
  729. #undef XmIsClipWindow
  730. #define XmIsClipWindow(w)  \
  731.   (_XmIsFastSubclass(XtClass(w), XmCLIP_WINDOW_BIT))
  732.  
  733. #undef XmIsComboBox
  734. #define XmIsComboBox(w)  \
  735.   (_XmIsFastSubclass(XtClass(w), XmCOMBO_BOX_BIT))
  736.  
  737. #undef XmIsCommandBox
  738. #define XmIsCommandBox(w)  \
  739.   (_XmIsFastSubclass(XtClass(w), XmCOMMAND_BOX_BIT))
  740.  
  741. #undef XmIsContainer
  742. #define XmIsContainer(w) \
  743.   (_XmIsFastSubclass(XtClass(w), XmCONTAINER_BIT))
  744.  
  745. #undef XmIsDialogShell
  746. #define XmIsDialogShell(w)  \
  747.   (_XmIsFastSubclass(XtClass(w), XmDIALOG_SHELL_BIT))
  748.  
  749. #undef XmIsDisplay
  750. #define XmIsDisplay(w)  \
  751.   (_XmIsFastSubclass(XtClass(w), XmDISPLAY_BIT))
  752.  
  753. #undef XmIsGrabShell
  754. #define XmIsGrabShell(w)  \
  755.   (_XmIsFastSubclass(XtClass(w), XmGRAB_SHELL_BIT))
  756.  
  757. #undef XmIsIconGadget
  758. #define XmIsIconGadget(w) \
  759.   (_XmIsFastSubclass(XtClass(w), XmICONGADGET_BIT))
  760.  
  761. #undef XmIsList
  762. #define XmIsList(w)  \
  763.   (_XmIsFastSubclass(XtClass(w), XmLIST_BIT))
  764.  
  765. #undef XmIsForm
  766. #define XmIsForm(w)  \
  767.   (_XmIsFastSubclass(XtClass(w), XmFORM_BIT))
  768.  
  769. #undef XmIsTextField
  770. #define XmIsTextField(w)  \
  771.   (_XmIsFastSubclass(XtClass(w), XmTEXT_FIELD_BIT))
  772.  
  773. #undef XmIsGadget
  774. #define XmIsGadget(w)  \
  775.   (_XmIsFastSubclass(XtClass(w), XmGADGET_BIT))
  776.  
  777. #undef XmIsLabel
  778. #define XmIsLabel(w)  \
  779.   (_XmIsFastSubclass(XtClass(w), XmLABEL_BIT))
  780.  
  781. #undef XmIsLabelGadget
  782. #define XmIsLabelGadget(w)  \
  783.   (_XmIsFastSubclass(XtClass(w), XmLABEL_GADGET_BIT))
  784.  
  785. #undef XmIsMainWindow
  786. #define XmIsMainWindow(w)  \
  787.   (_XmIsFastSubclass(XtClass(w), XmMAIN_WINDOW_BIT))
  788.  
  789. #undef XmIsManager
  790. #define XmIsManager(w)  \
  791.   (_XmIsFastSubclass(XtClass(w), XmMANAGER_BIT))
  792.  
  793. #undef XmIsMenuShell
  794. #define XmIsMenuShell(w)  \
  795.   (_XmIsFastSubclass(XtClass(w), XmMENU_SHELL_BIT))
  796.  
  797. #undef XmIsNotebook
  798. #define XmIsNotebook(w) \
  799.   (_XmIsFastSubclass(XtClass(w), XmNOTEBOOK_BIT))
  800.  
  801. #undef XmIsDragIcon
  802. #define XmIsDragIcon(w)  \
  803.   (_XmIsFastSubclass(XtClass(w), XmDRAG_ICON_BIT))
  804.  
  805. #undef XmIsDropSiteManager
  806. #define XmIsDropSiteManager(w)  \
  807.   (_XmIsFastSubclass(XtClass(w), XmDROP_SITE_MANAGER_BIT))
  808.  
  809. #undef XmIsDropTransfer
  810. #define XmIsDropTransfer(w)  \
  811.   (_XmIsFastSubclass(XtClass(w), XmDROP_TRANSFER_BIT))
  812.  
  813. #undef XmIsDragOverShell
  814. #define XmIsDragOverShell(w)  \
  815.   (_XmIsFastSubclass(XtClass(w), XmDRAG_OVER_SHELL_BIT))
  816.  
  817. #undef XmIsDragContext
  818. #define XmIsDragContext(w)  \
  819.   (_XmIsFastSubclass(XtClass(w), XmDRAG_CONTEXT_BIT))
  820.  
  821. #undef XmIsDrawnButton
  822. #define XmIsDrawnButton(w)  \
  823.   (_XmIsFastSubclass(XtClass(w), XmDRAWN_BUTTON_BIT))
  824.  
  825. #undef XmIsPrimitive
  826. #define XmIsPrimitive(w)  \
  827.   (_XmIsFastSubclass(XtClass(w), XmPRIMITIVE_BIT))
  828.  
  829. #undef XmIsPushButton
  830. #define XmIsPushButton(w)  \
  831.   (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_BIT))
  832.  
  833. #undef XmIsPushButtonGadget
  834. #define XmIsPushButtonGadget(w)  \
  835.   (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_GADGET_BIT))
  836.  
  837. #undef XmIsRowColumn
  838. #define XmIsRowColumn(w)  \
  839.   (_XmIsFastSubclass(XtClass(w), XmROW_COLUMN_BIT))
  840.  
  841. #undef XmIsScreen
  842. #define XmIsScreen(w)  \
  843.   (_XmIsFastSubclass(XtClass(w), XmSCREEN_BIT))
  844.  
  845. #undef XmIsScrollBar
  846. #define XmIsScrollBar(w)  \
  847.   (_XmIsFastSubclass(XtClass(w), XmSCROLL_BAR_BIT))
  848.  
  849. #undef XmIsScrolledWindow
  850. #define XmIsScrolledWindow(w)  \
  851.   (_XmIsFastSubclass(XtClass(w), XmSCROLLED_WINDOW_BIT))
  852.  
  853. #undef XmIsSelectionBox
  854. #define XmIsSelectionBox(w)  \
  855.   (_XmIsFastSubclass(XtClass(w), XmSELECTION_BOX_BIT))
  856.  
  857. #undef XmIsSeparator
  858. #define XmIsSeparator(w)  \
  859.   (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_BIT))
  860.  
  861. #undef XmIsSeparatorGadget
  862. #define XmIsSeparatorGadget(w)  \
  863.   (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_GADGET_BIT))
  864.  
  865. #undef XmIsSpinButton
  866. #define XmIsSpinButton(w)  \
  867.   (_XmIsFastSubclass(XtClass(w), XmSPINBUTTON_BIT))
  868.  
  869. #undef XmIsText
  870. #define XmIsText(w)  \
  871.   (_XmIsFastSubclass(XtClass(w), XmTEXT_BIT))
  872.  
  873. #undef XmIsTearOffButton
  874. #define XmIsTearOffButton(w)  \
  875.   (_XmIsFastSubclass(XtClass(w), XmTEAROFF_BUTTON_BIT))
  876.  
  877. #undef XmIsToggleButton
  878. #define XmIsToggleButton(w)  \
  879.   (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_BIT))
  880.  
  881. #undef XmIsToggleButtonGadget
  882. #define XmIsToggleButtonGadget(w)  \
  883.   (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_GADGET_BIT))
  884.  
  885. #undef XmIsPrintShell
  886. #define XmIsPrintShell(w)  \
  887.   (_XmIsFastSubclass(XtClass(w), XmPRINT_SHELL_BIT))
  888.  
  889. #undef XmIsArrowButton
  890. #define XmIsArrowButton(w)  \
  891.   (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_BIT))
  892.  
  893. #undef XmIsArrowButtonGadget
  894. #define XmIsArrowButtonGadget(w)  \
  895.   (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_GADGET_BIT))
  896.  
  897. #undef XmIsBulletinBoard
  898. #define XmIsBulletinBoard(w)  \
  899.   (_XmIsFastSubclass(XtClass(w), XmBULLETIN_BOARD_BIT))
  900.  
  901. #undef XmIsDrawingArea
  902. #define XmIsDrawingArea(w)  \
  903.   (_XmIsFastSubclass(XtClass(w), XmDRAWING_AREA_BIT))
  904.  
  905. #undef XmIsFileSelectionBox
  906. #define XmIsFileSelectionBox(w)  \
  907.   (_XmIsFastSubclass(XtClass(w), XmFILE_SELECTION_BOX_BIT))
  908.  
  909. #undef XmIsFrame
  910. #define XmIsFrame(w)  \
  911.   (_XmIsFastSubclass(XtClass(w), XmFRAME_BIT))
  912.  
  913. #undef XmIsMessageBox
  914. #define XmIsMessageBox(w)  \
  915.   (_XmIsFastSubclass(XtClass(w), XmMESSAGE_BOX_BIT))
  916.  
  917. #undef XmIsSash
  918. #define XmIsSash(w)  \
  919.   (_XmIsFastSubclass(XtClass(w), XmSASH_BIT))
  920.  
  921. #undef XmIsScale
  922. #define XmIsScale(w)  \
  923.   (_XmIsFastSubclass(XtClass(w), XmSCALE_BIT))
  924.  
  925. #undef XmIsPanedWindow
  926. #define XmIsPanedWindow(w)  \
  927.   (_XmIsFastSubclass(XtClass(w), XmPANED_WINDOW_BIT))
  928.  
  929. #undef XmIsCSText
  930. #define XmIsCSText(w)  \
  931.   (_XmIsFastSubclass(XtClass(w), XmCSTEXT_BIT))
  932.  
  933.  
  934. /************************************************************************
  935.  *
  936.  *  ResolveP.h
  937.  *
  938.  ************************************************************************/
  939.  
  940.  
  941. /*  Widget class indices used with XmPartOffset and XmField macros  */
  942.  
  943. #define XmObjectIndex         0
  944. #define ObjectIndex         XmObjectIndex
  945. #define XmRectObjIndex        (XmObjectIndex + 1)
  946. #define RectObjIndex        XmRectObjIndex
  947. #define XmWindowObjIndex    (XmRectObjIndex + 1)
  948. #define WindowObjIndex        XmWindowObjIndex
  949. #define XmCoreIndex         0
  950. #define CoreIndex         XmCoreIndex
  951. #define XmCompositeIndex     (XmWindowObjIndex + 2)
  952. #define CompositeIndex         XmCompositeIndex
  953. #define XmConstraintIndex     (XmCompositeIndex + 1)
  954. #define ConstraintIndex     XmConstraintIndex
  955. #define XmGadgetIndex         (XmRectObjIndex + 1)
  956. #define XmPrimitiveIndex     (XmWindowObjIndex + 2)
  957. #define XmManagerIndex         (XmConstraintIndex + 1)
  958.  
  959. #define XmArrowBIndex        (XmPrimitiveIndex + 1)
  960. #define XmArrowButtonIndex    XmArrowBIndex
  961. #define XmLabelIndex        (XmPrimitiveIndex + 1)
  962. #define XmListIndex        (XmPrimitiveIndex + 1)
  963. #define XmScrollBarIndex    (XmPrimitiveIndex + 1)
  964. #define XmSeparatorIndex    (XmPrimitiveIndex + 1)
  965. #define XmTextIndex        (XmPrimitiveIndex + 1)
  966. #define XmTextFieldIndex    (XmPrimitiveIndex + 1)
  967. #define XmCSTextIndex        (XmPrimitiveIndex + 1)
  968.  
  969. #define XmCascadeBIndex        (XmLabelIndex + 1)
  970. #define XmCascadeButtonIndex    XmCascadeBIndex
  971. #define XmDrawnBIndex        (XmLabelIndex + 1)
  972. #define XmDrawnButtonIndex    XmDrawnBIndex
  973. #define XmPushBIndex        (XmLabelIndex + 1)
  974. #define XmPushButtonIndex    XmPushBIndex
  975. #define XmToggleBIndex        (XmLabelIndex + 1)
  976. #define XmToggleButtonIndex    XmToggleBIndex
  977. #define XmTearOffButtonIndex    (XmPushBIndex + 1)
  978.  
  979. #define XmArrowBGIndex        (XmGadgetIndex + 1)
  980. #define XmArrowButtonGadgetIndex XmArrowBGIndex
  981. #define XmLabelGIndex        (XmGadgetIndex + 1)
  982. #define XmLabelGadgetIndex    XmLabelGIndex
  983. #define XmSeparatoGIndex    (XmGadgetIndex + 1)
  984. #define XmSeparatorGadgetIndex    XmSeparatoGIndex
  985.  
  986. #define XmCascadeBGIndex    (XmLabelGIndex + 1)
  987. #define XmCascadeButtonGadgetIndex XmCascadeBGIndex
  988. #define XmPushBGIndex        (XmLabelGIndex + 1)
  989. #define XmPushButtonGadgetIndex    XmPushBGIndex
  990. #define XmToggleBGIndex        (XmLabelGIndex + 1)
  991. #define XmToggleButtonGadgetIndex XmToggleBGIndex
  992. #define XmIconGadgetIndex    (XmGadgetIndex + 1)
  993.  
  994. #define XmBulletinBIndex    (XmManagerIndex + 1)
  995. #define XmBulletinBoardIndex    XmBulletinBIndex
  996. #define XmDrawingAIndex        (XmManagerIndex + 1)
  997. #define XmDrawingAreaIndex    XmDrawingAIndex
  998. #define XmClipWindowIndex    (XmDrawingAIndex + 1)
  999. #define XmFrameIndex        (XmManagerIndex + 1)
  1000. #define XmPanedWIndex        (XmManagerIndex + 1)
  1001. #define XmPanedWindowIndex    XmPanedWIndex
  1002. #define XmSashIndex        (XmPrimitiveIndex + 1)
  1003. #define XmRowColumnIndex    (XmManagerIndex + 1)
  1004. #define XmScaleIndex        (XmManagerIndex + 1)
  1005. #define XmScrolledWIndex    (XmManagerIndex + 1)
  1006. #define XmScrolledWindowIndex    XmScrolledWIndex
  1007.  
  1008. #define XmFormIndex        (XmBulletinBIndex + 1)
  1009. #define XmMessageBIndex        (XmBulletinBIndex + 1)
  1010. #define XmMessageBoxIndex    XmMessageBIndex
  1011. #define XmSelectioBIndex    (XmBulletinBIndex + 1)
  1012. #define XmSelectionBoxIndex    XmSelectioBIndex
  1013.  
  1014. #define XmMainWIndex        (XmScrolledWIndex + 1)
  1015. #define XmMainWindowIndex    XmMainWIndex
  1016.  
  1017. #define XmCommandIndex        (XmSelectioBIndex + 1)
  1018. #define XmFileSBIndex        (XmSelectioBIndex + 1)
  1019. #define XmFileSelectionBoxIndex    XmFileSBIndex
  1020.  
  1021. #define XmShellIndex         (XmCompositeIndex + 1)
  1022. #define ShellIndex         XmShellIndex
  1023. #define XmOverrideShellIndex     (XmShellIndex + 1)
  1024. #define OverrideShellIndex     XmOverrideShellIndex
  1025. #define XmWMShellIndex         (XmShellIndex + 1)
  1026. #define WMShellIndex         XmWMShellIndex
  1027. #define XmVendorShellIndex     (XmWMShellIndex + 1)
  1028. #define VendorShellIndex     XmVendorShellIndex
  1029. #define XmTransientShellIndex    (XmVendorShellIndex + 1)
  1030. #define TransientShellIndex    XmTransientShellIndex
  1031. #define XmTopLevelShellIndex     (XmVendorShellIndex + 1)
  1032. #define TopLevelShellIndex     XmTopLevelShellIndex
  1033. #define XmApplicationShellIndex (XmTopLevelShellIndex + 1)
  1034. #define ApplicationShellIndex     XmApplicationShellIndex
  1035. #define XmGrabShellIndex    (XmVendorShellIndex + 1)
  1036. #define XmDisplayIndex        (XmApplicationShellIndex + 1)
  1037.  
  1038. #define XmDialogSIndex        (XmTransientShellIndex + 1)
  1039. #define XmDialogShellIndex    XmDialogSIndex
  1040. #define XmMenuShellIndex    (XmOverrideShellIndex + 1)
  1041.  
  1042. #define XmContainerIndex    (XmManagerIndex + 1)
  1043. #define XmNotebookIndex        (XmManagerIndex + 1)
  1044. #define XmSpinButtonIndex    (XmManagerIndex + 1)
  1045. #define XmComboBoxIndex        (XmManagerIndex + 1)
  1046.  
  1047. #define XmDragIconIndex        (XmRectObjIndex + 1)
  1048. #define XmDropSiteManagerIndex  (XmObjectIndex + 1)
  1049. #define XmDropTransferIndex    (XmObjectIndex + 1)
  1050. #define XmDragOverShellIndex    (XmVendorShellIndex + 1)
  1051. #define XmDragContextIndex    (XmCoreIndex + 1)
  1052.  
  1053. /* 
  1054.  * XmOFFSETBITS is the number of bits used for the part offset within the
  1055.  * resource_offset field in the XmPartResource struct.  XmOFFSETMASK is the 
  1056.  * bitmask to mask for the part offset.
  1057.  */
  1058. #define XmOFFSETBITS (sizeof(Cardinal)*8/2)
  1059. #define XmOFFSETMASK ((1<<XmOFFSETBITS)-1)
  1060.  
  1061. typedef struct _XmPartResource {
  1062.     String     resource_name;    /* Resource name                */
  1063.     String     resource_class;    /* Resource class                */
  1064.     String     resource_type;    /* Representation type desired            */
  1065.     Cardinal   resource_size;    /* Size in bytes of representation        */
  1066.     Cardinal   resource_offset;    /* Index within & offset within part         */
  1067.     String     default_type;    /* representation type of specified default */
  1068.     XtPointer  default_addr;       /* Address of default resource            */
  1069. } XmPartResource;
  1070.  
  1071. #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(__cplusplus) || defined(ANSICPP)
  1072. # define XmPartOffset(part, variable) \
  1073.         ((part##Index) << XmOFFSETBITS) + XtOffsetOf( part##Part, variable)
  1074.  
  1075. # define XmConstraintPartOffset(part, variable) \
  1076.         ((part##Index) << XmOFFSETBITS) + \
  1077.     XtOffsetOf( part##ConstraintPart, variable)
  1078.  
  1079. # define XmGetPartOffset(r, offset) \
  1080.        ((r)->resource_offset & XmOFFSETMASK) + \
  1081.     (*(offset))[(r)->resource_offset >> XmOFFSETBITS]
  1082.  
  1083. # define XmField(widget, offsetrecord, part, variable, type) \
  1084.     (*(type *)(((char *) (widget)) + offsetrecord[part##Index] + \
  1085.         XtOffsetOf( part##Part, variable)))
  1086.  
  1087. # define XmConstraintField(widget, offsetrecord, part, variable, type) \
  1088.     (*(type *)(((char *) (widget)->core.constraints) + \
  1089.     offsetrecord[part##Index] + \
  1090.     XtOffsetOf( part##ConstraintPart, variable)))
  1091. #else
  1092. # define XmPartOffset(part, variable) \
  1093.         ((part/**/Index) << XmOFFSETBITS) + XtOffsetOf( part/**/Part, variable)
  1094.  
  1095. # define XmConstraintPartOffset(part, variable) \
  1096.         ((part/**/Index) << XmOFFSETBITS) + \
  1097.     XtOffsetOf( part/**/ConstraintPart, variable)
  1098.  
  1099. # define XmGetPartOffset(r, offset) \
  1100.        ((r)->resource_offset & XmOFFSETMASK) + \
  1101.     (*(offset))[(r)->resource_offset >> XmOFFSETBITS]
  1102.  
  1103. # define XmField(widget, offsetrecord, part, variable, type) \
  1104.     (*(type *)(((char *) (widget)) + offsetrecord[part/**/Index] + \
  1105.     XtOffsetOf( part/**/Part, variable)))
  1106.  
  1107. # define XmConstraintField(widget, offsetrecord, part, variable, type) \
  1108.     (*(type *)(((char *) (widget)->core.constraints) + \
  1109.     offsetrecord[part/**/Index] + \
  1110.     XtOffsetOf( part/**/ConstraintPart, variable)))
  1111. #endif
  1112.  
  1113. /***********************************************************************
  1114.  *
  1115.  *  RegionP.h
  1116.  *
  1117.  *  This structure must match the opaque libX Region structure.
  1118.  ***********************************************************************/
  1119.  
  1120. typedef struct {
  1121.     short x1, x2, y1, y2;
  1122. } XmRegionBox;
  1123.  
  1124. typedef struct _XmRegion {
  1125.     long    size;
  1126.     long    numRects;
  1127.     XmRegionBox    *rects;
  1128.     XmRegionBox    extents;
  1129. } XmRegionRec, *XmRegion;
  1130.  
  1131.  
  1132. /********    ResConvert.c    ********/
  1133.  
  1134. enum{    XmLABEL_FONTLIST = 1,        XmBUTTON_FONTLIST,
  1135.     XmTEXT_FONTLIST
  1136.     } ;
  1137.  
  1138. enum {
  1139.  XmLABEL_RENDER_TABLE = 1,
  1140.  XmBUTTON_RENDER_TABLE,
  1141.  XmTEXT_RENDER_TABLE
  1142. } ;
  1143.  
  1144. /**** Private Defines, Typedefs, and Function Declarations for XmString.c ****/
  1145.  
  1146. /* For _XmStringIndexCacheTag() and _XmStringCacheTag() length. */
  1147. #define XmSTRING_TAG_STRLEN        -1
  1148.  
  1149. /* For _XmStringGetNextTabWidth.  EOS = End Of String. */
  1150. typedef enum { XmTAB_NEXT, XmTAB_NEWLINE, XmTAB_EOS } NextTabResult; 
  1151.   
  1152. /********    End Private Function Declarations    ********/
  1153.  
  1154. /********    Traversal.c    ********/
  1155.  
  1156. #define XmTAB_ANY    ((XmNavigationType) 255)
  1157. #define XmNONE_OR_BC    ((XmNavigationType) 254)
  1158.  
  1159. typedef struct _XmFocusMovedCallbackStruct{
  1160.     int             reason;
  1161.     XEvent        *event;
  1162.     Boolean         cont;
  1163.     Widget         old_focus;
  1164.     Widget         new_focus;
  1165.     unsigned char     focus_policy;
  1166.     XmTraversalDirection direction; 
  1167. } XmFocusMovedCallbackStruct, *XmFocusMovedCallback;
  1168.  
  1169. typedef struct _XmFocusDataRec *XmFocusData;
  1170.  
  1171.  
  1172. /********    ResInd.c    ********/
  1173.  
  1174. typedef enum { 
  1175.   XmPARSE_ERROR, XmPARSE_NO_UNITS, XmPARSE_UNITS_OK 
  1176. } XmParseResult;
  1177.  
  1178.  
  1179.  
  1180. /********    Function Declarations for Xme        ********/
  1181.  
  1182.     /* GadgetUtil.c */
  1183. extern void XmeRedisplayGadgets( 
  1184.                         Widget w,
  1185.                         register XEvent *event,
  1186.                         Region region) ;
  1187. extern void XmeConfigureObject( 
  1188.                         Widget g,
  1189. #if NeedWidePrototypes
  1190.                         int x,
  1191.                         int y,
  1192.                         int width,
  1193.                         int height,
  1194.                         int border_width) ;
  1195. #else
  1196.                         Position x,
  1197.                         Position y,
  1198.                         Dimension width,
  1199.                         Dimension height,
  1200.                         Dimension border_width) ;
  1201. #endif /* NeedWidePrototypes */
  1202.     /* Traversal.c */
  1203. extern void XmeNavigChangeManaged( 
  1204.                         Widget wid) ;
  1205. extern Boolean XmeFocusIsInShell( 
  1206.                         Widget wid) ;
  1207.     /* ResInd.c */
  1208. extern XmImportOperator XmeToHorizontalPixels( 
  1209.                         Widget widget,
  1210.                         int offset,
  1211.                         XtArgVal *value) ;
  1212. extern XmImportOperator XmeToVerticalPixels( 
  1213.                         Widget widget,
  1214.                         int offset,
  1215.                         XtArgVal *value) ;
  1216. extern void XmeFromHorizontalPixels( 
  1217.                         Widget widget,
  1218.                         int offset,
  1219.                         XtArgVal *value) ;
  1220. extern void XmeFromVerticalPixels( 
  1221.                         Widget widget,
  1222.                         int offset,
  1223.                         XtArgVal *value) ;
  1224. extern XmParseResult XmeParseUnits(String spec, int *unitType);
  1225.     /* DragIcon. c */
  1226. extern Widget XmeGetTextualDragIcon(Widget w) ;
  1227.     /* BulletinB.c */
  1228. extern Widget XmeCreateClassDialog(
  1229.                     WidgetClass w_class,
  1230.             Widget ds_p,
  1231.                         String name,
  1232.                         ArgList bb_args,
  1233.                         Cardinal bb_n ) ;
  1234.     /* ImageCache.c */
  1235. extern Boolean XmeGetPixmapData( 
  1236.                         Screen *screen,
  1237.                         Pixmap pixmap,
  1238.                         char **image_name,
  1239.                         int *depth,
  1240.                         Pixel *foreground,
  1241.                         Pixel *background,
  1242.                         int *hot_x,
  1243.                         int *hot_y,
  1244.                         unsigned int *width,
  1245.                         unsigned int *height) ;
  1246. extern Pixmap XmeGetMask(
  1247.                         Screen *screen,
  1248.                         char *image_name) ;
  1249.     /* VirtKeys.c */
  1250. extern int XmeVirtualToActualKeysyms(
  1251.                          Display *dpy,
  1252.              KeySym virtKeysym,
  1253.                          XmKeyBinding *actualKeyData) ;
  1254.     /* Screen.c */
  1255. extern Cursor XmeGetNullCursor(Widget w) ;
  1256. extern void XmeQueryBestCursorSize(
  1257.             Widget w,
  1258.             Dimension *width,
  1259.             Dimension *height );
  1260.     /* Xm.c */
  1261. extern void XmeWarning( Widget w, char *message ) ;
  1262.     /* ResConvert.c */
  1263. extern XmFontList XmeGetDefaultRenderTable(
  1264.         Widget w,
  1265. #if NeedWidePrototypes
  1266.         unsigned int fontListType );
  1267. #else
  1268.         unsigned char fontListType );
  1269. #endif /* NeedWidePrototypes */
  1270. extern Boolean XmeNamesAreEqual(
  1271.         register char *in_str,
  1272.         register char *test_str );
  1273.     /* Primitive.c */
  1274. extern void XmeResolvePartOffsets(
  1275.             WidgetClass w_class,
  1276.             XmOffsetPtr *offset,
  1277.             XmOffsetPtr *constraint_offset ) ;
  1278.     /* XmString.c */
  1279. extern Boolean XmeStringIsValid( XmString string ) ;
  1280. extern void XmeSetWMShellTitle(
  1281.             XmString xmstr,
  1282.             Widget shell) ;
  1283. extern XmIncludeStatus XmeGetDirection(XtPointer *in_out,
  1284.                        XtPointer text_end,
  1285.                        XmTextType type,
  1286.                        XmStringTag locale_tag,
  1287.                        XmParseMapping entry,
  1288.                        int pattern_length,
  1289.                        XmString *str_include,
  1290.                        XtPointer call_data);
  1291. extern XmIncludeStatus XmeGetNextCharacter(XtPointer *in_out,
  1292.                        XtPointer text_end,
  1293.                        XmTextType type,
  1294.                        XmStringTag locale_tag,
  1295.                        XmParseMapping entry,
  1296.                        int pattern_length,
  1297.                        XmString *str_include,
  1298.                        XtPointer call_data);
  1299. extern XmStringComponentType XmeStringGetComponent(_XmStringContext context, 
  1300.                            Boolean        update_context,
  1301.                            Boolean        copy_data,
  1302.                            unsigned int    *length,
  1303.                            XtPointer       *value);
  1304.     /* XmFontList.c */
  1305. extern Boolean XmeRenderTableGetDefaultFont(
  1306.             XmFontList fontlist,
  1307.             XFontStruct **font_struct ) ;
  1308.     /* GMUtils.c */
  1309. extern XtGeometryResult XmeReplyToQueryGeometry(
  1310.             Widget widget,
  1311.             XtWidgetGeometry * intended,
  1312.             XtWidgetGeometry * desired) ;
  1313.     /* Color.c */
  1314. extern void XmeGetDefaultPixel(
  1315.                         Widget widget,
  1316.                         int type,
  1317.                         int offset,
  1318.                         XrmValue *value) ;
  1319.     /* Xmos.c */
  1320. extern String XmeGetHomeDirName(void) ;
  1321. extern int XmeMicroSleep( 
  1322.                         long secs) ;
  1323. extern XmString XmeGetLocalizedString( 
  1324.                         char *reserved,
  1325.                         Widget widget,
  1326.                         char *resource,
  1327.                         String string) ;
  1328.  
  1329. /********    End Function Declarations for Xme        ********/
  1330.  
  1331. /********        ********/
  1332.  
  1333. #ifdef __cplusplus
  1334. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  1335. #endif
  1336.  
  1337.  
  1338. #include <Xm/BaseClassP.h>       
  1339.  
  1340.  
  1341. /***********************************************************************
  1342.  *
  1343.  *  Motif 1.2 BC compilation.
  1344.  *
  1345.  ***********************************************************************/
  1346.  
  1347. #ifndef NO_XM_1_2_BC
  1348.  
  1349. /*
  1350.  * These routines have all been made obsolete by public Xme functions.
  1351.  * The declarations here are intended solely as an aid to porting,
  1352.  * and will be removed in a future release.  All applications should
  1353.  * name the Xme methods directly.
  1354.  *
  1355.  * _XmVirtualToActualKeysym, _XmResizeObject, and _XmMoveObject have
  1356.  * Xme counterparts with slightly different semantics or parameters,
  1357.  * so a simple rename will not work for them.
  1358.  */
  1359.  
  1360. #define _XmClearBorder            XmeClearBorder
  1361. #define _XmConfigureObject        XmeConfigureObject
  1362. #define _XmDrawArrow            XmeDrawArrow
  1363. #define _XmDrawDiamond            XmeDrawDiamond
  1364. #define _XmDrawSeparator        XmeDrawSeparator
  1365. #define _XmDrawShadows            XmeDrawShadows
  1366. #define _XmDrawSimpleHighlight        XmeDrawHighlight
  1367. #define _XmFontListGetDefaultFont    XmeRenderTableGetDefaultFont
  1368. #define _XmFromHorizontalPixels        XmeFromHorizontalPixels
  1369. #define _XmFromVerticalPixels        XmeFromVerticalPixels
  1370. #define _XmGMReplyToQueryGeometry    XmeReplyToQueryGeometry
  1371. #define _XmGetDefaultFontList        XmeGetDefaultRenderTable
  1372. #define _XmGetMaxCursorSize        XmeQueryBestCursorSize
  1373. #define _XmGetNullCursor        XmeGetNullCursor
  1374. #define _XmGetTextualDragIcon        XmeGetTextualDragIcon
  1375. #define _XmInputInGadget        XmObjectAtPoint
  1376. #define _XmMicroSleep            XmeMicroSleep
  1377. #define _XmNavigChangeManaged        XmeNavigChangeManaged
  1378. #define _XmOSGetHomeDirName        XmeGetHomeDirName
  1379. #define _XmOSGetLocalizedString        XmeGetLocalizedString
  1380. #define _XmRedisplayGadgets        XmeRedisplayGadgets
  1381. #define _XmStringIsXmString        XmeStringIsValid
  1382. #define _XmStringUpdateWMShellTitle    XmeSetWMShellTitle
  1383. #define _XmStringsAreEqual        XmeNamesAreEqual
  1384. #define _XmToHorizontalPixels        XmeToHorizontalPixels
  1385. #define _XmToVerticalPixels        XmeToVerticalPixels
  1386. #define _XmWarning            XmeWarning
  1387.  
  1388.  
  1389. /*
  1390.  * These routines are really undocumented and internal, but have been
  1391.  * used widely enough as data that they are preserved here for source
  1392.  * compatibility.
  1393.  */
  1394.  
  1395. extern void _XmDestroyParentCallback( 
  1396.                         Widget w,
  1397.                         XtPointer client_data,
  1398.                         XtPointer call_data) ;
  1399.  
  1400.  
  1401. /*
  1402.  * Use of these internal macros is sufficiently widespread that they
  1403.  * are still made available here for source compatibility.
  1404.  */
  1405.  
  1406. /* The _XmCreateImage macro is used to create XImage with client
  1407.  * specific data for the bit and byte order.  We still have to do the
  1408.  * following because XCreateImage will stuff here display specific
  1409.  * data and we want client specific values (i.e the bit orders we used
  1410.  * for creating the bitmap data in Motif) */
  1411. #define _XmCreateImage(IMAGE, DISPLAY, DATA, WIDTH, HEIGHT, BYTE_ORDER) {\
  1412.     IMAGE = XCreateImage(DISPLAY,\
  1413.              DefaultVisual(DISPLAY, DefaultScreen(DISPLAY)),\
  1414.              1,\
  1415.              XYBitmap,\
  1416.              0,\
  1417.              DATA,\
  1418.              WIDTH, HEIGHT,\
  1419.              8,\
  1420.              (WIDTH+7) >> 3);\
  1421.     IMAGE->byte_order = BYTE_ORDER;\
  1422.     IMAGE->bitmap_unit = 8;\
  1423.     IMAGE->bitmap_bit_order = LSBFirst;\
  1424. }
  1425.  
  1426. #endif /* NO_XM_1_2_BC */
  1427.  
  1428. #endif /* _XmP_h */
  1429. /* DON'T ADD STUFF AFTER THIS #endif */
  1430.